package com.xiaode.common;


/**
 * 维护用户token
 */
public class UserTokenManager {
	
	public static String generateToken(String info) {
        return JwtHelper.createToken(info);
    }
	
    public static String getInfo(String token) {
    	return JwtHelper.verifyTokenAndGetInfo(token);
    }
    
    public static void main(String[] args) {
//    	String str = UserTokenManager.generateToken(Kv.by("accountId", 122334).set("userType", Const.UserType.student).toJson());
//    	System.out.println(str);
    	String str = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJ6eS50b2tlbiIsImF1ZCI6InVzZXIiLCJpc3MiOiJ6eS5hY2NvdW50U2VydmljZSIsImV4cCI6MTY2NzgxOTc5MiwiaWF0IjoxNjY2NjEwMTkyLCJpbmZvIjoie1wiYWNjb3VudElkXCI6MTcyOCxcInVzZXJUeXBlXCI6MH0ifQ.EblXi03iIOsqQ5FNf9MCy-vJ8PH2j1IYmh2RyclGwUE";
    	String s = getInfo(str);
    	System.out.println(s);
	}
    
}
